#ifndef __disjointset_h__
#define __disjointset_h__

#include <iostream>
#include <iomanip>
#include <cassert>
#include <list>

using namespace std;

class DisjointSet {
	
		int cantNodos;
		int *tieneFabrica;
		int *links;
		int *ranks;

	public:
		DisjointSet(int fabricas, int clientes);
		~DisjointSet();

		int padre(int i);
		bool unir(int i, int j);

		friend ostream& operator<<(ostream &os, const DisjointSet &ds);
};

ostream& operator<<(ostream &os, const DisjointSet &ds);

#endif /* __disjointset_h__ */
